<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>版本审核管理</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"><!-- 确保适当的绘制和触屏缩放 -->
	<link rel="stylesheet" href="{$url_css}bootstrap.min.css" type="text/css">
	<link rel="stylesheet" href="{$url_css}admin.css" type="text/css">
	<script type="text/javascript" src="{$url_js}jquery-1.12.0.min.js"></script>
</head>
<body>

<div class="container" style="width:96%"> 
	<table class="table table-bordered table-striped" align="center">
		<tr>

			<td>
				<nav class="navbar navbar-default">
					<div class="navbar-header">
						<span class="navbar-brand">版本审核管理</span>
					</div>
				</nav>
			</td>
		</tr>
		<form action="?do=add" method="post">
			<tr>
				<td class="form-inline" width="20%" colspan="4">
					<div class="input-group">
						<div class="input-group-addon">更换新版本</div>
						<input class="form-control" name="version" value="{$version_info}">
					</div>
					<input type="submit" value="更新" id="add_btn" class="btn btn-primary"/>
				</td>
			</tr>
		</form>
	</table>
	<table class="table table-striped table-bordered">
		<tr>
			<td colspan="3">
				<nav class="navbar navbar-default">
					<div class="navbar-header">
						<span class="navbar-brand">是否显示手机登陆</span>
					</div>
				</nav>
			</td>
		</tr>
		<tr align="center">
			<td width="20%">
				<div class="input-group-addon">手机登陆开关：</div>
			</td>
			<td style="width:120px"><input class="code btn btn-default" type="button" data="{$code_info}"
			                              value="{if $code_info == 1}是{else}否{/if}"/>
			</td>
			<td>
				&nbsp;
			</td>
		</tr>
	</table>
</div>

{literal}
	<script type="application/javascript">
        //hot设置
        $(".code").each(function () {
            var _this = $(this);
            $(this).hover(function () {
                if (_this.attr('data') == 1) {
                    _this.val('否');
                } else {
                    _this.val('是');
                }
            }, function () {
                if (_this.attr('data') == 1) {
                    _this.val('是');
                } else {
                    _this.val('否');
                }
            });

            $(this).click(function () {
                var code = $(this).attr('data');
                $.ajax({
                    url: '?do=UpdataByCode',
                    type: "POST",
                    dataType: "json",
                    data: {code: code},
                    success: function (json) {
                        if (json.type == 'yes') {
                            if (json.rel == 1) {
                                _this.val('是');
                            } else {
                                _this.val('否');
                            }
                            top.swal('操作成功！', '成功！', 'success');
                            location.reload();
                        } else {
                            top.swal('操作失败！', '还有机会！', 'error');
                            location.reload();
                        }
                    }
                });
            });
        });
	</script>
{/literal}
</body>
<html>